﻿$(function(){//延迟加载
	var ysId='';
	$('#failurelist').datagrid({
		url:'showfailurelist',
		queryParams:{
			failuretypeId:'',
		},
		
		method:'get',
		toolbar: [{
			text:'新增故障',
			iconCls: 'icon-add',
			handler: function(){alert('编辑按钮')}
		},'-',{
			text:'确认修改',
			iconCls: 'icon-save',
			handler: function(){alert('帮助按钮')}
		},'-',{
			text:'删除故障',
			iconCls: 'icon-remove',
			handler: function(){alert('帮助按钮')}
		},'-',{
			text:'取消修改',
			iconCls: 'icon-undo',
			handler: function(){alert('帮助按钮')}
		}],
		columns:[[{
			field:'failurename',
			title:"故障名称",
			width:'15%'
		},{
			field:'failuretype',
			title:"故障类型",
			width:'15%'
		},{
			field:'dvbelongs',
			title:"故障设备类型",
			width:'32%'
		},{
			field:'descri',
			title:"故障描述",
			width:'35%'
		}]],
		fit:true,
		pagination:true,
		rownumbers:true
	});
	$('#ceshi').linkbutton({
		text:'测试',
		onClick:function(){
			$('#userlist').datagrid('reload',{
				url:'showuserlist?departmentId='+'root',
			});
		}
	});
	if($('#ysfdId').val()!=''){//如果fdId有值，则载入failurelist
		//alert($('#ysdpId').val());
		$('#failurelist').datagrid('reload',{
			failuretypeId:'root'
		});
	}
});